using UnityEngine;
using System.Collections;

public partial class Interface{

    public static Airport activeAirport;

    public static void DrawATCInterface() {
        
        GUILayout.Box(activeAirport.airportName.ToString() + " ATC");
        foreach (Aircraft departingAircraft in activeAirport.outboundPlanes) {
            //Debug.Log(departingAircraft.gameObject.name + "Ready to take off.");
            if (departingAircraft.flightPhase == Aircraft.FlightPhase.departing) {
                if (GUILayout.Button("Authorise departure of " + departingAircraft.gameObject.name)) {
                    departingAircraft.TakeOffAeroplane(activeAirport);
                }
            }
        }
        if (activeAirport.inboundPlanes.Count != 0) {
            foreach (Aircraft p in activeAirport.inboundPlanes) {
                if (p.flightPhase == Aircraft.FlightPhase.holding) {
                    if (GUILayout.Button("Land " + p.gameObject.name)) {//TODO:replace with name
                        p.RecievePermissionToLand();
                    }
                }
            }
        } else {
            GUILayout.Box("No inbound planes");
        }
    }

}
